package com.ktwlsoft.archivemanage.payload.menu;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@Setter
@Getter
@ApiModel("分配行动请求")
public class DispatchActionRequest {

    @ApiModelProperty("行动角色关系列表")
    private List<ActionRole> actionRoles;

    /**角色Id**/
    @ApiModelProperty("角色Id")
    @NotNull(message = "角色id不能为空")
    private Long roleId;

    /**角色名称**/
    @ApiModelProperty("角色名称")
    @NotBlank(message = "角色名称不能为空")
    private String roleName;

    @ApiModel("行动角色关系")
    @Setter
    @Getter
    public static class ActionRole{

        /**菜单Id**/
        @ApiModelProperty("行为Id")
        @NotNull
        private Long actionId;

        /**菜单名称**/
        @ApiModelProperty("行为名称")
        @NotBlank
        private String actionName;

        @ApiModelProperty("此行为的直接上级菜单id")
        @NotNull
        private Long menuId;

        @ApiModelProperty("此行为的直接上级菜单名称")
        @NotBlank
        private String menuName;

        public ActionRole(){}

        public ActionRole(@NotNull Long actionId, @NotBlank String actionName, @NotNull Long menuId, @NotBlank String menuName) {
            this.actionId = actionId;
            this.actionName = actionName;
            this.menuId = menuId;
            this.menuName = menuName;
        }
    }
}
